﻿namespace net.zxteam.ZXLexer.Dynamic.Internal
{
    using net.zxteam.ZXLexer.Tokens;
    using System;
    using System.Collections.Generic;

    internal abstract class Token : IToken, IEnumerable<IToken>
    {
        public IEnumerator<IToken> GetEnumerator()
        {
            return this.GetChildren().GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return this.GetEnumerator(); }

        protected abstract IEnumerable<IToken> GetChildren();
    }
}
